package com.hw.service.impl;

import com.github.pagehelper.PageInfo;
import com.hw.dao.DocumentDao;
import com.hw.pojo.HwCategory;
import com.hw.pojo.HwEntry;
import com.hw.service.DocumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: DocumentServiceImpl
 * @Description: 电子文档业务逻辑处理
 * @Author: vie0134
 * @Date: 2020-12-25 15:06
 * @Version: 1.0
 **/
@Service
public class DocumentServiceImpl implements DocumentService {
    @Autowired
    private DocumentDao documentDao;

    @Override
    public PageInfo<HwEntry> findAllArea(int pageNum, int pageSize, Map<String, Object> map) {
        return null;
    }

    @Override
    public List<HwCategory> findListName() {
        return documentDao.findListName();
    }

    @Override
    public HwCategory findCategoryById(Integer id) {
        return documentDao.findCategoryById(id);
    }

    @Override
    public List<HwEntry> findListEntry() {
        return documentDao.findListEntry();
    }


    @Override
    public boolean updateEntry(HwEntry hwEntry) {
        if (0 != documentDao.updateEntry(hwEntry)) {
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteEntry(Integer id) {
        if (0 != documentDao.deleteEntry(id)) {
            return true;
        }
        return false;
    }

    @Override
    public boolean insertEntry(HwEntry hwEntry) {
        if (0 != documentDao.insertEntry(hwEntry)) {
            return true;
        }
        return false;

    }

    @Override
    public HwEntry findEntryById(Integer id) {
        return documentDao.findEntryById(id);
    }
}
